package org.move.server.controller;

import org.move.server.bean.MovieTicket;
import org.move.server.bean.User;
import org.move.server.http.UserFeignClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MovieController {
	
	@Autowired
	UserFeignClient userFeignClient;
	
	
	@GetMapping("getUserName")
	public String getUserName(){
		
		return "movie";  
	}
	
	
	@GetMapping("getUserMovieTicket")
	public MovieTicket getUserMovieTicket(){
		MovieTicket movieTicket = new MovieTicket();
		
		User user = userFeignClient.getUser();
		
		movieTicket.setId(user.getId());
		movieTicket.setUserName(user.getUsername());
		movieTicket.setName("name");
		movieTicket.setUserId("setUserId");
		return movieTicket;  
	}
	
	
	
}
